package com.stylefeng.guns.modular.revenue.service;

import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.core.exception.GunsException;
import com.stylefeng.guns.modular.revenue.model.Revenue;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author stylefeng123
 * @since 2018-06-30
 */
public interface IRevenueService extends IService<Revenue> {

    /**
     * 查询报表
     * @param platform
     * @param beginDate
     * @param endDate
     * @return
     */
    public List<Map<String,Object>> selectRevenue (String platform,String beginDate,String endDate);

    /**
     * 添加盈亏报表
     * @param revenue
     * @throws RuntimeException
     */
    public void addRevenue (Revenue revenue)throws GunsException;

    /**
     * 批量添加盈亏报表
     * @param revenues
     * @throws RuntimeException
     */
    public void addRevenues (List<Revenue> revenues)throws GunsException;

    /**
     * 修改盈亏报表
     * @param revenue
     * @throws RuntimeException
     */
    public void updateRevenue (Revenue revenue)throws GunsException;

    /**
     *  查询平台当前是否已经存记录
     * @param platform
     * @param revtime
     * @return
     * @throws RuntimeException
     */
    public Revenue getViewPfr(String platform, Date revtime)throws RuntimeException;

    /**
     * 根据月份计算当月的总盈亏
     * @return
     */
    public Revenue getRevenueByMoth(String platform,Date beginDate,Date endDate);

    /**
     * 导出获取数据
     */
    public List<Map<String,Object>> getExcelList(String platform,String beginDate,String endDate) ;


    /**
     * 导出获取数据 合计
     */
    public List<Map<String,Object>> getExcelListTotal(String platform,String beginDate,String endDate);





}
